﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class tipForm : Form
    {
        selection parent;
        public tipForm(selection parent)
        {
            this.parent = parent;
            InitializeComponent();
        }

        private void addButton_Click(object sender, EventArgs e)
        {
            addOrEditTip secondForm = new addOrEditTip();
            secondForm.Text = "Add Tip";
            secondForm.ShowDialog();
        }

        private void editButton_Click(object sender, EventArgs e)
        {
            addOrEditTip secondForm = new addOrEditTip();
            secondForm.Text = "Edit Tip";
            secondForm.ShowDialog();
        }

        private void backButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            parent.Show();
        }

        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);
            DialogResult result = MessageBox.Show("Are you sure you want to exit the program?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result != DialogResult.Yes)
                e.Cancel = true;
            else
                Environment.Exit(1);
        }

        private void tipForm_Load(object sender, EventArgs e)
        {

        }

        private void deleteButton_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete the selected tip?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result != DialogResult.Yes)
            {
            }
            else
            {
            }
        }
    }
}
